import request from "@/utils/request";
import { stringify } from "qs";
import { toFormData } from "@/utils/utils.jsx";

//查询标签类型
export async function queryLabelTypeEnumList(params) {
	return request(`/new-common/labelTemplate/labelTypeEnumList?${stringify(params)}`);
}

//获取模版尺寸
export async function queryListTemplateSize(params) {
	return request(`/new-common/labelTemplate/listTemplateSize?${stringify(params)}`);
}

//获取标签模板表格数据;
export async function getTableDataOp(params) {
	return request(`/new-common/labelTemplate/list`, {
		method: "post",
		data: params
	});
}

//修改标签模板表格数据;
export async function updateTableDataOp(params) {
	return request(`/new-common/labelTemplate/update`, {
		method: "post",
		data: params
	});
}

//删除标签模板表格数据
export async function deleteTableDataOp(params) {
	return request(`/new-common/labelTemplate/delete`, {
		method: "post",
		// data: params
		body: toFormData(params)
	});
}

// add
export async function addKuaimaiOp(params) {
	return request(`/new-common/labelTemplate/save`, {
		method: "POST",
		data: params
	});
}

// copy
export async function copyKuaimaiOp(params) {
	return request(`/new-common/labelTemplate/copy`, {
		method: "POST",
		data: params
	});
}

// update
export async function updateKuaimaiOp(params) {
	return request(`/new-common/labelTemplate/update`, {
		method: "POST",
		data: params
	});
}

// 标签排序
export async function labelSort(params) {
	return request(`/new-common/labelTemplate/labelSort`, {
		method: "POST",
		data: params
	});
}

//字段管理
export async function queryFieldManageList(params) {
	return request(`/new-common/fieldManage/list?${stringify(params)}`);
}

//标签店铺id列表
export async function queryLabelStoreIdList(params) {
	return request(`/new-common/labelTemplate/labelStoreIdList?${stringify(params)}`);
}
